{layout name="layout" /}

<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    <a href="{:url('admin/index/index')}"> 首页</a>
    <span class="c-gray en">&gt;</span>
    <a href="{:url('admin/admin_menu/index')}">菜单管理</a>
    <span class="c-gray en">&gt;</span>
    <a href="javascprit:;">{$data.id ? '修改' : '新增'}</a>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
        title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>

<div class="Hui-article">
	<article class="cl pd-20">
		<form action="{:url('doAddOrEdit','id='.$data.id)}" method="post" class="form form-horizontal" id="form-admin-menu">
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">上级权限</label>
				<div class="formControls col-xs-8 col-sm-4">
					<span class="select-box" style="width:150px;">
						<select class="select" id="pid" name="pid">
							<option value="0" {eq name='data.pid' value="0" }selected{/eq}>--新增顶级权限--</option>
							{foreach $data_permission as $value}
							<option value="{$value.id}" {eq name='data.pid' value="$value.id" }selected{/eq}>----{$value.name}----</option>
							{/foreach}
						</select>
					</span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">
					<span class="c-red">*</span> 菜单名称:</label>
				<div class="formControls col-xs-8 col-sm-4">
					<input type="text" class="input-text" value="{$data.name}"  placeholder="请输入目录名称" id="name" name="name" />
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">
					<span class="c-red">*</span> url:</label>
				<div class="formControls col-xs-8 col-sm-4">
					<input type="text" class="input-text" value="{$data.url}"  placeholder="请输入url,菜单无需填写" id="url" name="url" />
				</div>
				<span style="color:red;">* 小写字母</span>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-2 col-sm-2">
					<span class="c-red">*</span> 权限:</label>
				<div class="formControls col-xs-8 col-sm-4">
					<input type="text" class="input-text" value="{$data.perms}" placeholder="权限名,例admin:user:delete" id="perms" name="perms" />
				</div>
				<span style="color:red;">* 小写字母</span>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">目录类型:</label>
				<div class="formControls col-xs-8 col-sm-2">
					<span class="select-box" style="width:150px;">
						<select class="select" id="type" name="type">
							<option value="0" {eq name='data.type' value="0" }selected{/eq}>目录</option>
							<option value="1" {eq name='data.type' value="1" }selected{/eq}>菜单</option>
							<option value="2" {eq name='data.type' value="2" }selected{/eq}>按钮</option>
						</select>
					</span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">图标样式:</label>
				<div class="formControls col-xs-4 col-sm-2">
					<input type="text" class="input-text" value="{$data.icon|str_replace='&', '&amp;', ###}" placeholder="图片值" id="icon" name="icon" />
				</div>
				<div class="formControls col-xs-2 col-sm-2">
					预览：<i class="Hui-iconfont">{$data.icon}</i>
				</div>
				<span style="color:red;">* 图标示例 <a href="/static/admin/lib/Hui-iconfont/1.0.8/demo.html" target="_blank" style="color:blue;" rel="noopener noreferrer"> demo</a></span>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<button type="submit" class="btn btn-success radius" id="admin-powers-save" name="">确&nbsp;定</button>
					<button type="button" class="btn btn-default radius" onclick="window.history.back();" style="margin-left:20px;">取&nbsp;消</button>
				</div>
			</div>
		</form>
	</article>
</div>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
	$(function () {
		// $("#form-admin-menu").submit(function () {


		// })
		
	})
</script>